Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue of wrong results when querying external label values #6339

Closed

Conversation

dmitrime
Copy link

@dmitrime dmitrime commented May 5, 2023

I took a try at issue #6338
You may have more context or ideas how to improve it.

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Removed code that immediately returns external label value. Added code that returns its value after matching is done.

Verification

Added new tests.

@@ -58,6 +58,12 @@ func testLabelAPIs(t *testing.T, startStore func(extLset labels.Labels, append f
{start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), expectErr: errors.New("rpc error: code = InvalidArgument desc = label name parameter cannot be empty")},
{start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), label: "foo"},
{start: timestamp.FromTime(minTime), end: timestamp.FromTime(maxTime), label: "region", expectedValues: []string{"eu-west"}}, // External labels should be visible.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's uncertain whether this test should pass? There are no series, but external label is returned anyway? I didn't touch it because the comment says it should be visible. In case you agree that it's wrong too, I can tweak the PR to account for that (we would need to check len(vals) > 0 returned from storepb.LabelValuesResponse).

@GiedriusS
Copy link
Member

Fixed in #6816, sorry not taking a look at your PR. Thanks for your contribution.

@GiedriusS GiedriusS closed this Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants